#include <cstdint>
#include <sstream>
#include <string>
using namespace std;
namespace MC500 {
    
    struct DateTime{
        uint16_t year;
        uint8_t month;
        uint8_t dayOfMonth;
        uint8_t hour;
        uint8_t min;
        uint8_t sec;
    };

    std::string ConvertSize(uint64_t size, uint8_t unit = 0);

    class TrifficInfo {
    public:
        TrifficInfo(uint64_t upload, uint64_t download):uploadSpeed(upload), downloadSpeed(download){}
        std::string GetUploadSpeed() {
            return ConvertSize(uploadSpeed);
        }
        std::string GetDownloadSpeed() {
            return ConvertSize(downloadSpeed);
        }
    private:
        uint64_t uploadSpeed;
        uint64_t downloadSpeed;
        friend class SystemInfo;
        friend class LinuxSystemInfo;
    };
    
    class SystemInfo{
        public:
        SystemInfo() = default;
        virtual ~SystemInfo() = default;
        virtual uint64_t GetPhyMem(void);
        virtual uint64_t GetPhyMemUsed(void);

        virtual uint8_t GetCPUUsed(void);
        virtual DateTime GetDateTime();
        virtual DateTime GetStableRunningTime();
        virtual TrifficInfo GetTrifficInfo(const string &portName);
        virtual uint8_t GetDiskUsage(const string &partition);

        static SystemInfo* GetInstance();

        private:
        static SystemInfo* _ins;
    };    
}